<template>
	<view class="box">
		<view class="list" v-for="(item,index) in haslist" @click="historyinfo(item)">
			<view class="up">
				<image :src="`../../static/images/${item.lottery_id}.png`" mode=""></image>
				<span>{{item.lottery_no}}期 {{item.lottery_date}} 开奖</span>
			</view>
			<view class="down">
				<span v-for="(m,i) in item.lottery_res.split(',') ">{{m}}</span>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				history:'' , // 彩票id\
				haslist:[]
			}
		},
		mounted() {  
			this.history = this.$mp.query.lottery_id
			// console.log(this.history);
			uni.request({   //请求接口获取数据
				url:'http://api.aslegou.top/api/cphistory',
				method:'GET',
				data:{
					lottery_id:this.$mp.query.lottery_id
				},
				success: (res) => {
					this.haslist = res.data.list.lotteryResList
				}
			})
		},
		methods:{
			historyinfo(item){
				uni.navigateTo({
					url:`/pages/home/hasinfo?lottery_id=${item.lottery_id}&lottery_no=${item.lottery_no}`
				})
			}
		}
		
	}
</script>

<style lang="scss"> 
	.list{
		padding: 50rpx;
		border-bottom: 1px solid;
		.up{
			display: flex;
			image{
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
			}
			span{
				line-height:100rpx ;
				margin-left: 40rpx;
			}
		}
		.down{
			display: flex;
			span{
				border: 1px solid red;
				border-radius: 50%;
				color: red;
				padding: 5rpx;
				margin-left: 10rpx;
			}
		}
	}
</style>